-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stackdriver: add cloud_logging_base_url #9779
base: master
Are you sure you want to change the base?
Conversation
fc94712
to
22a2369
Compare
Add the `Cloud_Logging_Base_Url` configuration option to the `out_stackdriver` plugin. Signed-off-by: braydonk <[email protected]>
22a2369
to
34d7c0c
Compare
cloud_logging_base_url_str = flb_sds_create_size(cloud_logging_base_url_size); | ||
|
||
/* Note: The size calculated from `flb_sds_len` does not include the null terminator character, | ||
* `size` argument for `flb_sds_snprintf` needs to be the size including the null terminator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many invocations of flb_sds_snprintf
use the direct result of flb_sds_alloc
as the size, which does not count the null terminator; in all cases, those invocations do not adjust by +1. (example)
Though the docs for the underlying snprintf
are clear that the size should count the null terminator...
I'm not sure what I'm missing but it seems that either the docs are wrong and size
should not count the null, or all of the existing invocations of flb_sds_snprintf
are wrong and should be counting it 🤔
if (ctx->project_id) { | ||
flb_sds_destroy(ctx->project_id); | ||
} | ||
|
||
|
||
if (ctx->tag_prefix_k8s) { | ||
flb_sds_destroy(ctx->tag_prefix_k8s); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you need to destroy ctx->cloud_logging_base_url
too? Or is this only for the fields that aren't registered in the config map?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since ctx->cloud_logging_base_url
is set from the config map, it will be destroyed here:
Line 96 in 68f1887
flb_kv_release(&ins->properties); |
(this is a bit confusing to trace, and I only found it while valgrinding when I had originally manually destroyed it here and got an invalid free at that line)
Add the
Cloud_Logging_Base_Url
configuration option to theout_stackdriver
plugin. This feature is to support alternateuniverse_domain
s in the output plugin. A majority of users will never need to change this.Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
Please refer to the Valgrind output below. In that output, I used a universe domain that doesn't exist; I don't have an effective way to test an alternate universe domain at the moment. I also tested with
https://logging.googleapis.com
manually set through the config to still test the config building path that constructs the domain from the base URL in the config and it worked the same.Valgrind debug output with https://logging-other.com
Valgrind debug output with https://logging.googleapis.com manually set
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-test
label to test for all targets (requires maintainer to do).Documentation
fluent/fluent-bit-docs#1538
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.